package com.github.kezhenxu94.playground.java.sorting;

public class SelectionSort {

	public void sort(int[] array) {
		int len = array.length;
		for (int i = 0; i < len; i++) {
			int minIndex = i;
			for (int j = i; j < len; j++)
				if (array[j] < array[minIndex])
					minIndex = j;
			ArrayUtil.swap(array, minIndex, i);
		}
	}
	
}
